/// API常量配置
class ApiConstants {
  /// API基础URL
  static const String baseUrl = 'http://192.168.1.105:8000';

  /// API版本
  static const String apiVersion = 'v1';

  /// 超时时间（秒）
  static const int timeout = 10;
}

/// 认证相关接口常量
class AuthApiConstants {
  static const String prefix = '/auth';
  static const String register = '$prefix/register';
  static const String login = '$prefix/login';
  static const String refresh = '$prefix/refresh';
}

/// 文件相关接口常量
class FilesApiConstants {
  static const String prefix = '/api/files';
  static const String upload = '/api/upload';
  static const String list = prefix;
  static const String verify = '/api/verify';
  static const String batchRestore = '$prefix/batch-restore';

  // 单个文件操作需要拼接文件ID
  static String delete(int fileId) => '$prefix/$fileId';
  static String rename(int fileId) => '$prefix/$fileId/rename';
  static String preview(int fileId) => '$prefix/$fileId/preview';
  static String download(int fileId) => '$prefix/$fileId/download';
}

/// 分块上传相关接口常量
class ChunkUploadApiConstants {
  static const String prefix = '/api/chunk-upload';
  static const String init = '$prefix/init';
  static const String uploadChunk = '$prefix/upload-chunk';
  static const String complete = '$prefix/complete';

  // 需要ID的操作
  static String status(String taskId) => '$prefix/status/$taskId';
  static String abort(String taskId) => '$prefix/abort/$taskId';
}

/// 目录相关接口常量
class DirectoriesApiConstants {
  static const String prefix = '/api/directories';
  static const String list = prefix;
  static const String tree = '$prefix/tree';
  static const String batchDelete = '$prefix/batch-delete';
  static const String moveItems = '$prefix/move-items';

  // 单个目录操作需要拼接目录ID
  static String get(int dirId) => '$prefix/$dirId';
  static String update(int dirId) => '$prefix/$dirId';
  static String delete(int dirId) => '$prefix/$dirId';
  static String files(int dirId) => '$prefix/$dirId/files';
}

/// 备份相关接口常量
class BackupsApiConstants {
  static const String prefix = '/api/backups';
  static const String list = prefix;

  // 需要ID的操作
  static String get(int backupId) => '$prefix/$backupId';
  static String execute(int backupId) => '$prefix/$backupId/execute';
  static String restore(int backupId) => '$prefix/$backupId/restore';
  static String files(int backupId) => '$prefix/$backupId/files';
  static String restoreTask(String taskId) => '$prefix/restore-tasks/$taskId';
}
